package com.srcptit.java.tranning.hoangdd.btvn1;

import java.util.Scanner;

public class Bai3Muc1 {
	public static boolean ngto(int n){
		if(n<2)
			return false;
		for(int i=2; i<=Math.sqrt(n); i++)
			if(n%i==0) 
				return false;
		return true;
	}
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.print(" Nhap vao 1 so nguyen = ");
		int a = sc.nextInt();             // so ma nguoi su dung nhap vao
		int kt= 2;     // kt la cac so nguyen to se duoc in ra man hinh
		while(a>0){
			if(ngto(a) == true){
				System.out.print(a);
				break;
				}
			else
				if(ngto(kt) == true)
					if(a%kt == 0){
						System.out.print(kt+ " ");
						a/=kt;
						}
					else
						kt++;
		}
	}

}

